#ifndef __BSP_PWM_H
#define __BSP_PWM_H
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include "main.h"

#ifdef CHIP_TYPE_L1
#define	PWMHTIMHANDLE 			htim3
#define	PWMCHANNEL1 			TIM_CHANNEL_3
#define	PWMCHANNEL2 			TIM_CHANNEL_4
#endif
#ifdef CHIP_TYPE_L4
#define	PWMHTIMHANDLE 			htim1
#define	PWMCHANNEL1 			TIM_CHANNEL_2
#define	PWMCHANNEL2 			TIM_CHANNEL_3
#endif
#ifdef CHIP_TYPE_F4
#define	PWMHTIMHANDLE 			htim5
#define	PWMCHANNEL1 			TIM_CHANNEL_4
#define	PWMCHANNEL2 			TIM_CHANNEL_3
#endif
__packed typedef struct
{
	char *name;
	TIM_HandleTypeDef *TimHandle;
	uint32_t Channel;
	uint8_t  open_flag;
}BSP_PWM;




void PWM_Start(char *name);
void PWM_Stop(char *name);
void PWM_SetDuty(char *name,float Duty);










#endif



